(function (doc, win) {
    var docEl = doc.documentElement,
      resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
      recalc = function () {
        var clientWidth = docEl.clientWidth;
        if (!clientWidth) return;
        docEl.style.fontSize = 24 * (clientWidth / 640) + 'px';
      };
    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false);
  })(document, window);
  
  
  //顺便提一下，微信小程序中的rpx
  //rpx以750px为标准
  //1rpx = (1/750*设备宽度)px
  //假如设备宽度为750px,那么1rpx= 1/750 * 750 px = 1px;
  //假如设备宽度为640x,那么1rpx= 1/750 * 640 px = 0.85333px;